import {createApp} from 'vue'

import App from './App.vue'
import router from './routers/index'
import store from './store'
import './assets/styles/index.scss'
import Cookies from 'js-cookie'

const app = createApp(App)

// svg 图标
import 'virtual:svg-icons-register' // 引入注册脚本
import SvgIcon from './components/SvgIcon/index.vue'
import elementIcons from './components/SvgIcon/svgicon'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import locale from 'element-plus/dist/locale/zh-cn.mjs' // 中文语言

import plugins from './plugins' // plugins


import VueTypedJs from 'vue-typed-js'
// 导入打字机
import vueTyped from 'vue3typed'

//引入这两个包
import './permission' // permission control


import DevUI from 'vue-devui';
import 'vue-devui/style.css';
import '@devui-design/icons/icomoon/devui-icon.css';
import { ThemeServiceInit, infinityTheme } from 'devui-theme';

ThemeServiceInit({ infinityTheme }, 'infinityTheme');

app.component('SvgIcon', SvgIcon)

app.use(router)
app.use(elementIcons)
app.use(DevUI)
app.use(VueTypedJs)
app.use(vueTyped)

// 全局组件挂载
app.use(ElementPlus, {
    locale: locale,
    // 支持 large、default、small
    size: Cookies.get('size') || 'default',
})
app.use(plugins)
app.use(store)
app.mount('#app')
